import service from '@/utils/fetch'

export default {
  prefix: `${service.product}/brand`,
  getList(data = {}) {
    let url = this.prefix + '/list'
    return service.get(url, data)
  },
  update(data = {}) {
    let url = this.prefix + '/update'
    return service.post(url, data)
  },
  save(data = {}) {
    let url = this.prefix + '/save'
    return service.post(url, data)
  },
  saveOrUpdate(data,type) {
    return type === 'save' ? this.save(data):this.update(data)
  },
  get(data) {
    let url = `${this.prefix}/info/${data}`
    return service.get(url, null)
  },
  delete(id) {
    let url = `${this.prefix}/delete`
    return service.post(url, id)
  }
}
